package psn.kiko.constant;

import psn.kiko.pojo.vo.LabelValue;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据库离散列常量
 */
public class DBConstant{
	/**
	 * 存放所有启禁状态值
	 */
	private static final List<Short> statuses = new ArrayList<>(2);
	private static final List<LabelValue> statusesWithLabel = new ArrayList<>(2);
	/**
	 * 存放所有编辑状态值
	 */
	private static final List<Short> editValues = new ArrayList<>(2);
	private static final List<LabelValue> editValuesWithLabel = new ArrayList<>();
	
	/**
	 * 存放所有导航类型：导航类型，0-导航组，1-导航项；默认为导航项
	 */
	private static final List<Short> navigationTypes = new ArrayList<>(2);
	private static final List<LabelValue> navigationTypesWithLabel = new ArrayList<>(2);
	/**
	 * 1-启用
	 */
	public static final short ENABLE = 1;
	/**
	 * 0-禁用
	 */
	public static final short DISABLE = 0;
	
	/**
	 * 1-可编辑
	 */
	public static final short EDITABLE = 1;
	/**
	 * 0-不可编辑
	 */
	public static final short UN_EDITABLE = 0;
	
	/**
	 * 0-未登录状态
	 */
	public static final short LOGOUT_STATUS = 0;
	/**
	 * 1-登录状态
	 */
	public static final short LOGIN_STATUS = 1;
	
	/**
	 * 0-导航组
	 */
	public static final short NAVIGATION_GROUP = 0;
	/**
	 * 1-导航项
	 */
	public static final short NAVIGATION_ITEM = 1;
	
	/**
	 * -1(或<=0),导航项为未分配状态
	 */
	public static final int NAVIGATION_ITEM_UN_ALLOCATED = -1;
	
	//向各集合添加元素
	static{
		statuses.add(ENABLE);
		statuses.add(DISABLE);
		statusesWithLabel.add(new LabelValue("启用",ENABLE));
		statusesWithLabel.add(new LabelValue("禁用",DISABLE));
		
		editValues.add(EDITABLE);
		editValues.add(UN_EDITABLE);
		editValuesWithLabel.add(new LabelValue("可编辑",EDITABLE));
		editValuesWithLabel.add(new LabelValue("不可编辑",UN_EDITABLE));
		
		navigationTypes.add(NAVIGATION_GROUP);
		navigationTypes.add(NAVIGATION_ITEM);
		navigationTypesWithLabel.add(new LabelValue("导航组",NAVIGATION_GROUP));
		navigationTypesWithLabel.add(new LabelValue("导航项",NAVIGATION_ITEM));
	}
	
	/**
	 * 获取启用状态值集合
	 */
	public static List<Short> getStatuses(){
		return statuses;
	}
	
	/**
	 * 获取启用状态值集合（携带状态值说明）
	 */
	public static List<LabelValue> getStatusesWithLabel(){
		return statusesWithLabel;
	}
	
	/**
	 * 获取编辑状态值集合
	 */
	public static List<Short> getEditValues(){
		return editValues;
	}
	
	/**
	 * 获取编辑状态值集合（携带状态值说明）
	 */
	public static List<LabelValue> getEditValuesWithLabel(){
		return editValuesWithLabel;
	}
	
	/**
	 * 获取导航类型值集合
	 */
	public static List<Short> getNavigationTypes(){
		return navigationTypes;
	}
	
	/**
	 * 获取导航类型值集合（携带类型值说明）
	 */
	public static List<LabelValue> getNavigationTypesWithLabel(){
		return navigationTypesWithLabel;
	}
	
	private DBConstant(){}
}
